package cn.tedu.toa.management.sys.controller;


import cn.tedu.toa.management.commons.vo.Result;
import cn.tedu.toa.management.sys.entity.FBresources;
import cn.tedu.toa.management.sys.service.FBresourcesService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 业务资源表 前端控制器
 * </p>
 *
 * @author huaqian
 * @since 2021-10-02
 */
@RestController
@RequestMapping("/f-bresources")
public class FBresourcesController {
    @Autowired
    private FBresourcesService bresourcesService;
    @Value("${myconfig.page-size}")
    private Integer pageSize;


    @GetMapping("/getBresources")
    public Result getBresources(){
        List<FBresources> bresources=bresourcesService.getFBresources();
        return Result.ok(bresources);
    }

    @GetMapping("/findBresourceList")
    public Result findBresourceList( String servicename, @RequestParam(defaultValue = "1") Integer pageNum){
        PageInfo<FBresources> bresources=bresourcesService.findBresourcesList( servicename, pageNum, pageSize);
        return Result.ok(bresources);
    }

}
